@extends('admin')

@section('content')

    <p class="mb10">
        <a href="{{url('admin/product/update')}}" class="btn J_dialog" title="发布产品"><span class="add"></span>发布产品</a>
    </p>

    <div class="h_a">搜索</div>
    <div class="search_type cc mb10">
        <form action="{{url('admin/product')}}" method="get" class="search_form">
            <label for="search_title">产品名称：</label><input type="text" name="name" value="{{$name}}" id="search_title" class="input length_2 mr10"/>
            <button type="submit" class="btn">提交查询</button>
        </form>

    </div>

    <div class="table_list">
        <div id="data_list">
            <table class="items">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>产品名称</th>
                    <th>所属类别</th>
                    <th>发布者</th>
                    <th>发布时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach ($list as $item)
                    <tr>
                        <td>{{$item->id}}</td>
                        <td>{{$item->name}}</td>
                        <td>{{$item->type->name}}</td>
                        <td>{{$item->poster->nick}}</td>
                        <td>{{$item->created_at}}</td>
                        <td>
                            <a href="{{url('admin/product/update/'.$item->id)}}" title="编辑 {{$item->name}}" class="mr10 J_dialog">[编辑]</a>
                            <a href="{{url('admin/product/delete/'.$item->id)}}" class="mr10 J_ajax_del">[删除]</a>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>

        <div class="summary">
            共有 {{$list->total()}} 条数据
        </div>
        @if ($list->hasPages())
            <div class="pager">
                {!! $list->appends($appends)->render() !!}
            </div>
        @endif
    </div>

@stop